import base from '@/api/baseurl';
import request from '@/utils/request'

export function findCurve(query) {
  return request({
    baseURL: base.appBaseApi,
    url: '/tfpr/findCurve',
    method: 'get',
    params: query
  })
}

//单行删除
export function deleteParamterszi(query) {
  return request({
    baseURL: base.appBaseApi,
    url: '/atigs/delEnterTheParameter',
    method: 'get',
    params: query
  })
}


export function addCurve(data) {
  return request({
    baseURL: base.appBaseApi,
    url: '/tfpr/addCurve',
    method: 'post',
    data
  })
}

export function updateParamterszi(data) {
  return request({
    baseURL: base.appBaseApi,
    url: '/atigs/updateConfiguration',
    method: 'post',
    data
  })
}

/**
 * 获取转移曲线编号options
 * @param {*} query 
 * @returns   "cv_code": "2021111802", "cv_name": "境内FTP转移收益率曲线"
 */
export function findCvCode(query) {
  return request({
    baseURL: base.appBaseApi,
    url: '/tfpr/findCvCode',
    method: 'get',
    params: query
  })
}

/**
 * 获取转移曲线编号对应表单参数
 * @param {*} query  cv_code  s_date  e_date
 * @returns   
 */
 export function findTremCode(query) {
  return request({
    baseURL: base.appBaseApi,
    url: '/tfpr/findTremCode',
    method: 'get',
    params: query
  })
}



/**
 * 获取转移曲线编号对应表单参数的单位
 * @param {*} query  cv_code  s_date  e_date
 * @returns   
 */
 export function findUile(query) {
  return request({
    baseURL: base.appBaseApi,
    url: '/tfpr/findUile',
    method: 'get',
    params: query
  })
}


/**
 * 计算利息周期类型Options
 * @param {*} query  
 * @returns   
 */
 export function findInterestCycle(query) {
  return request({
    baseURL: base.appBaseApi,
    url: '/tfpr/findInterestCycle',
    method: 'get',
    params: query
  })
}


/**
 * 调整类型Options
 * @param {*} query  
 * @returns   
 */
 export function findAdjustTheType(query) {
  return request({
    baseURL: base.appBaseApi,
    url: '/tfpr/findAdjustTheType',
    method: 'get',
    params: query
  })
}



// 1.tfpr/findSinglePricing  子表的查询  
// 2.tfpr/addSinglePricing  子表的新增  
// 3.tfpr/updateSinglePricing  子表的修改  
// 4..tfpr/delSinglePricing  子表的删除




/**
 * 转移价格调整规则器-列表
 * @param {*} query  
 * @returns   
 */
 export function findSinglePricing(query) {
  return request({
    baseURL: base.appBaseApi,
    url: '/tfpr/findSinglePricing',
    method: 'get',
    params: query
  })
}

/**
 * 转移价格调整规则器-新增
 * @param {*} query  
 * @returns   
 */
export function addSinglePricing(data) {
  return request({
    baseURL: base.appBaseApi,
    url: '/tfpr/addSinglePricing',
    method: 'post',
    data
  })
}

/**
 * 转移价格调整规则器-修改
 * @param {*} query  
 * @returns   
 */
 export function updateSinglePricing(data) {
  return request({
    baseURL: base.appBaseApi,
    url: '/tfpr/updateSinglePricing',
    method: 'post',
    data
  })
}

/**
 * 转移价格调整规则器-删除
 * @param {*} query  
 * @returns   
 */
export function delSinglePricing(query) {
  return request({
    baseURL: base.appBaseApi,
    url: '/tfpr/delSinglePricing',
    method: 'get',
    params: query
  })
}